import type {TableListParams} from './data';
import axios from "axios";

/**
 * 查询登录日志
 * @param params
 */
export async function queryLoginLog(params: TableListParams) {
  try {
    const response = await axios.get('/api/sys/loginLog/listoo',{
      params: {
       ...params,
      },
    });
    // console.log(response.data);
    return response.data;
  } catch (error) {
    // console.error('Error fetching data:', error);
    return [];
  }
}

/**
 * 批量删除登录日志
 * @param params
 */
export async function removeLoginLog(params: { ids: number[] }) {
  try {
    const response = await axios.delete('/api/sys/loginLog/delete',{
      params: {
        ...params,
      },
    });
    // console.log(response.data);
    return response.data;
  } catch (error) {
    // console.error('Error fetching data:', error);
    return [];
  }
}
